﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.UI;
using YArchitech.Controls;

namespace YJKCopyModel.InteractiveOperation.CmdTestInteractiveOperation
{
	internal class TestInteractiveOperationInputRequestMaker : InteractiveOperationBase
	{
		public override bool IfBreak
		{
			get
			{
				return true;
			}
		}

		public TestInteractiveOperationInputRequestMaker(ExternalCommandData useExternalCommandData) : base(useExternalCommandData)
		{
		}

		public override List<InputRequest> GetAllInputRequest()
		{
			List<InputRequest> list = new List<InputRequest>();
			TestCurveRequest testCurveRequest = new TestCurveRequest();
			testCurveRequest.UseExternalCommandData = this.m_useExternalCommandData;
			List<ICadElement> list2 = new List<ICadElement>();
			foreach (CurveInfo item in this.m_lstCurve)
			{
				list2.Add(item);
			}
			testCurveRequest.SelectDataMap.Add("线", list2);
			list.Add(testCurveRequest);
			return list;
		}

		public override void PrepareRequest()
		{
			bool flag = !this.m_dwgEntitiesSelection.TryPickSameLayerAllCurve(out this.m_lstCurve, true, SelecteEntType.eLine | SelecteEntType.eArc | SelecteEntType.ePolyLine, "");
			if (flag)
			{
				bool flag2 = this.m_dwgEntitiesSelection.Result == DwgEntitiesSelectionResult.eUnitError;
				if (flag2)
				{
					YJKMessageBox.Information("链接图纸的单位不是“毫米”，请重新链接图纸并将导入单位设置为“毫米”");
				}
				else
				{
					bool flag3 = this.m_dwgEntitiesSelection.Result == DwgEntitiesSelectionResult.eDwgPathError;
					if (flag3)
					{
						YJKMessageBox.Information("所链接图纸的源文件不存在，请重新链接。");
					}
				}
				throw new Exception();
			}
		}

		public override void CloseFrom()
		{
			throw new NotImplementedException();
		}

		private List<CurveInfo> m_lstCurve = new List<CurveInfo>();
	}
}
